<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <link rel="icon" href="../../images/hospital-icon.png" type="image/x-icon">  <!--在网页标题左侧显示图标-->
    <!--    <link rel="shortcut icon" href="./images/hospital-icon.png" type="image/x-svg">-->
    <link rel="shortcut icon" href="../../images/hospital-icon.png" type="image/x-icon"><!--在收藏夹显示图标-->

    <title>员工管理-门诊管理系统</title>

    <!--时间风格及输入框风格-->
    <!--pickers css-->
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-datepicker/css/datepicker-custom.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-timepicker/css/timepicker.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-colorpicker/css/colorpicker.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-daterangepicker/daterangepicker-bs3.css" />
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-datetimepicker/css/datetimepicker-custom.css" />

    <link href="../../css/style.css" rel="stylesheet">
    <link href="../../css/style-responsive.css" rel="stylesheet">
    <!--时间风格及输入框风格-->

    <!--data table-->
    <link rel="stylesheet" href="../../js/data-tables/DT_bootstrap.css" />

    <link href="../../css/style.css" rel="stylesheet">
    <link href="../../css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="../../js/html5shiv.js"></script>
    <script src="../../js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <!--左侧开始-->
    <div class="left-side sticky-left-side">

        <!--logo and iconic logo start-->
        <!--侧边栏顶部图标+文字-->
        <div class="logo">
            <a href="index_admin.html">
                <img src="../../images/hospital-icon.png" alt="" style="width: 40px;height: 40px">
                <p style="display: inline-block;font-size: 24px;">门诊管理系统</p>
            </a>
        </div>

        <!--收起状态的侧边栏顶部图标-->
        <div class="logo-icon text-center">
            <a href="../../index.html"><img src="../../images/hospital-icon.png" alt="" style="width: 40px;height: 40px"></a>
        </div>
        <!--logo and iconic logo end-->

        <div class="left-side-inner">

            <!--sidebar nav start-->
            <!--侧边栏-->
            <ul class="nav nav-pills nav-stacked custom-nav">


                <li class="menu-list">
                    <a href="">
                        <i class="fa fa-book"></i>
                        <span>患者管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="admissionList.html"> 入院登记管理</a></li>
                        <li><a href="appointmentList.html">预约挂号管理</a></li>
                        <li><a href="patientInfoList.html"> 患者信息管理</a></li>
                    </ul>
                </li>

                <li class="menu-list nav-active">
                    <a href="">
                        <i class="fa fa-book"></i>
                        <span>门诊管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="departmentList.html"> 科室管理</a></li>
                        <li class="active"><a href="staffList.html">员工管理</a></li>
                        <li><a href="emrList.html"> 电子病历管理</a></li>
                        <li><a href="orderList.html"> 医嘱管理</a></li>
                    </ul>
                </li>
                <li class="menu-list">
                    <a href="">
                        <i class="fa fa-cogs"></i>
                        <span>药库管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="drugInfoList.html"> 药库库存管理</a></li>
                        <li><a href="itemList.html"> 产品管理</a></li>
                        <li><a href="pickingList.html"> 捡药发药管理</a></li>
                        <li><a href="prescriptionList.html"> 处方管理</a></li>
                    </ul>
                </li>

                <li class="menu-list">
                    <a href="fontawesome.html">
                        <i class="fa fa-bullhorn"></i>
                        <span>账单管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="billList.html"> 账单管理</a></li>
                        <li><a href="journalList.html"> 缴费单管理</a></li>
                    </ul>
                </li>

                <li class="menu-list">
                    <a href="">
                        <i class="fa fa-tasks"></i>
                        <span>用户管理</span>
                    </a>
                    <ul class="sub-menu-list">
                        <li><a href="userList.html"> 用户管理</a></li>
                    </ul>
                </li>

                <li class="logout">
                    <a href="#">
                        <i class="fa fa-sign-in"></i>
                        <span>退出登录</span>
                    </a>
                </li>

            </ul>
            <!--sidebar nav end-->
            <!--侧边栏导航结束-->

        </div>
    </div>
    <!-- left side end-->
    <!-- 左侧 部分 结束 -->

    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <!--顶部菜单部分开始-->
        <div class="header-section">

            <!--toggle button start-->
            <!--拨动按钮-收起侧边栏-->
            <a class="toggle-btn"><i class="fa fa-bars"></i></a>
            <!--toggle button end-->

            <!--notification menu start -->
            <!--通知菜单开始-->
            <div class="menu-right" id="headerApp">
                <ul class="notification-menu">

                    <li>
                        <a href="#" class="btn btn-default dropdown-toggle info-number logout" data-toggle="dropdown">
                            退出登录
                            <i class="fa fa-sign-out"></i>
                        </a>
                    </li>


                </ul>
            </div>
            <!--notification menu end -->
            <!--通知菜单结束-->
        </div>
        <!-- header section end-->
        <!--顶部菜单部分结束-->

        <!--body wrapper start-->
        <div class="wrapper" id="staffApp">
            <div class="row">
                <div class="col-sm-12">
                    <section class="panel">
                        <header class="panel-heading">
                            员工管理
                            <span class="tools pull-right"></span>
                        </header>
                        <div class="panel-body">
                            <div class="adv-table editable-table ">

                                <div class="clearfix"  style="margin-bottom: 20px">
                                    <form class="form-inline" role="form">

                                        <a href="#newAdmission" class="btn btn-info details" data-toggle="modal">
                                            新增
                                            <i class="fa fa-plus"></i>
                                        </a>

                                        <!-- Modal -->
                                        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="newAdmission" class="modal fade">
                                            <div class="modal-dialog">
                                                <div class="modal-content">
                                                    <div class="modal-header" style="width: auto;height: auto">
                                                        <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                        <h4 class="modal-title">新增员工</h4>
                                                    </div>
                                                    <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">选择用户:</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addSelectUserName" @change="addSelectUserList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据用户名或昵称查询">
                                                                <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                                    <li v-for="user in selectUserList">
                                                                        <a href="#" @click="addCheckThisUser(user.userId,user.userName,user.userNickName)">
                                                                            <span v-text="user.userId">1</span>
                                                                            <span v-text="user.userName"> 曾晨</span>
                                                                            <span v-text="user.userNickName"> 曾晨</span>
                                                                        </a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">员工姓名</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addStaffName" class="col-sm-12" type="text" class="form-control" placeholder="请输入员工姓名">
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">性别:</label>
                                                            <div class="col-sm-8">
                                                                <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                                    <span v-text="addSexName">性别</span>
                                                                    <span class="caret"></span>
                                                                </button>
                                                                <ul role="menu" class="dropdown-menu">
                                                                    <li><a href="#" @click="addCheckThisSex(0,'男')">男</a></li>
                                                                    <li><a href="#" @click="addCheckThisSex(1,'女')">女</a></li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">出生年月日</label>
                                                            <div class="col-sm-8">
                                                                <input id="addStaffBob" class="form-control form-control-inline input-medium default-date-picker"  size="16" type="text" value=""  placeholder="选择时间" />
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">职称名称</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addJobTitle" class="col-sm-12" type="text" class="form-control" placeholder="请输入职称名称">
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">选择科室:</label>
                                                            <div class="col-sm-8">
                                                                <input v-model="addDepartmentName" @change="addSelectDepartmentList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据科室名称查询">
                                                                <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                                    <li v-for="department in selectDepartmentList">
                                                                        <a href="#" @click="checkThisDepartment(department.id,department.departmentName)">
                                                                            <span v-text="department.id">1</span>
                                                                            <span>-</span>
                                                                            <span v-text="department.specialtyName"> 曾晨</span>
                                                                            <span>-</span>
                                                                            <span v-text="department.departmentName"> 曾晨</span>
                                                                            <span>-</span>
                                                                            <span v-text="department.departmentAddress"> 曾晨</span>
                                                                        </a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                            <label class="col-sm-4 control-label">工作人员类别:</label>
                                                            <div class="col-sm-8">
                                                                <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                                    <span v-text="addJobTypeName">工作人员类别 </span>
                                                                    <span class="caret"></span>
                                                                </button>
                                                                <ul role="menu" class="dropdown-menu">
                                                                    <li><a href="#" @click="addCheckThisJobType(1,'缴费员')">缴费员</a></li>
                                                                    <li><a href="#" @click="addCheckThisJobType(2,'护士')">护士</a></li>
                                                                    <li><a href="#" @click="addCheckThisJobType(3,'医生')">医生</a></li>
                                                                    <li><a href="#" @click="addCheckThisJobType(4,'药师')">药师</a></li>
                                                                    <li><a href="#" @click="addCheckThisJobType(5,'管理员')">管理员</a></li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal" @click="addStaffReset()">取消</button>
                                                        <button type="button" class="btn btn-success" @click="saveAddStaff()">保存</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                               <span v-text="selectPageSizeName"> 分页数 </span>
                                                <span class="caret"></span>
                                            </button>
                                            <ul role="menu" class="dropdown-menu">
                                                <li><a href="#" @click="checkThisPageSize(10)">10</a></li>
                                                <li><a href="#" @click="checkThisPageSize(20)">20</a></li>
                                                <li><a href="#" @click="checkThisPageSize(30)">30</a></li>
                                            </ul>
                                        </div>

                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                <span v-text="selectSexName"> 性别 </span>
                                                <span class="caret"></span>
                                            </button>
                                            <ul role="menu" class="dropdown-menu">
                                                <li><a href="#" @click="checkThisSex(0,'男')">男</a></li>
                                                <li><a href="#" @click="checkThisSex(0,'女')">女</a></li>
                                            </ul>
                                        </div>

                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                <span v-text="selectJobTypeName"> 工作类别 </span>
                                                <span class="caret"></span>
                                            </button>
                                            <ul role="menu" class="dropdown-menu">
                                                <li><a href="#" @click="checkThisJobType(1,'缴费员')">缴费员</a></li>
                                                <li><a href="#" @click="checkThisJobType(2,'护士')">护士</a></li>
                                                <li><a href="#" @click="checkThisJobType(3,'医生')">医生</a></li>
                                                <li><a href="#" @click="checkThisJobType(4,'药师')">药师</a></li>
                                                <li><a href="#" @click="checkThisJobType(5,'管理员')">管理员</a></li>
                                            </ul>
                                        </div>

                                        <div class="form-group">
                                            <input v-model="selectStaffName" type="text" class="form-control" style="width: 300px" placeholder="根据员工名称模糊查询">
                                        </div>

                                        <button type="button" class="btn btn-info" @click="selectStaffList()">
                                            查询
                                            <i class="fa fa-search"></i>
                                        </button>
                                        <button type="button" class="btn btn-default" @click="resetSelectStaffList()">
                                            重置
                                            <i class="fa fa-undo"></i>
                                        </button>

                                    </form>
                                </div>


                                <table class="table table-striped table-hover table-bordered" id="editable-sample">
                                    <thead>
                                    <tr>
                                        <th>员工ID</th>
                                        <th>用户ID</th>
                                        <th>员工姓名</th>
                                        <th>性别</th>
                                        <th>出生年月</th>
                                        <th>职称名称</th>
                                        <th>科室名称</th>
                                        <th>工作人员类别</th>
                                        <th>修改</th>
                                        <th>删除</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr class="" v-for="staff in StaffList">
                                        <td v-text="staff.staffId">1</td>
                                        <td v-text="staff.userId">1</td>
                                        <td v-text="staff.staffName">曾晨</td>
                                        <td>
                                            <span v-if="staff.sex==0">男</span>
                                            <span v-if="staff.sex==1">女</span>
                                        </td>
                                        <td v-text="staff.dateOfBirth">1999年02月</td>
                                        <td v-text="staff.jobTitleName">科室主任</td>
                                        <td v-text="staff.departmentName">骨科一科</td>
                                        <td>
                                            <span v-if="staff.jobType==1">缴费员</span>
                                            <span v-if="staff.jobType==2">护士</span>
                                            <span v-if="staff.jobType==3">医生</span>
                                            <span v-if="staff.jobType==4">药师</span>
                                            <span v-if="staff.jobType==5">管理员</span>
                                        </td>

                                        <td>
                                            <a href="#modifyStaff" class="details" style="color: #46b8da;" data-toggle="modal" @click="modifyStaff(staff.staffId)">修改</a>
                                        </td>

                                        <td>
                                            <a :href="'#deleteyStaff'+staff.staffId" class="details" style="color: #46b8da;" data-toggle="modal">删除</a>
                                            <!-- Modal -->
                                            <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" :id="'deleteyStaff'+staff.staffId" class="modal fade">
                                                <div class="modal-dialog">
                                                    <div class="modal-content">
                                                        <div class="modal-header" style="width: auto;height: auto">
                                                            <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                            <h4 class="modal-title">删除预约</h4>
                                                        </div>
                                                        <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                            <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                                <label class="col-sm-4 control-label">是否确认删除预约</label>
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                            <button type="button" class="btn btn-success" @click="deleteThisStaff(staff.staffId)">确认</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>

                                <!--修改组件-->
                                <!-- Modal -->
                                <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="modifyStaff" class="modal fade">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header" style="width: auto;height: auto">
                                                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                                <h4 class="modal-title">修改员工信息</h4>
                                            </div>
                                            <div class="modal-body"  style="width: auto;height: auto;position: relative">
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">员工ID</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyStaffDetail.staffId" class="col-sm-12" type="text" class="form-control" placeholder="请输入员工ID" disabled>
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">用户:</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyStaffDetail.userId + modifyStaffDetail.staffName" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据用户名或昵称查询" disabled>
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">性别:</label>
                                                    <div class="col-sm-8">
                                                        <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                            <span v-text="modifyStaffDetail.sexName">性别</span>
                                                            <span class="caret"></span>
                                                        </button>
                                                        <ul role="menu" class="dropdown-menu">
                                                            <li><a href="#" @click="modifyCheckThisSex(0,'男')">男</a></li>
                                                            <li><a href="#" @click="modifyCheckThisSex(1,'女')">女</a></li>
                                                        </ul>
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">出生年月日</label>
                                                    <div class="col-sm-8">
                                                        <input :value="modifyStaffDetail.returnDateOfBirth" id="modifyStaffDob" class="form-control form-control-inline input-medium default-date-picker"  size="16" type="text" value=""  placeholder="选择时间" />
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">职称名称</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyStaffDetail.jobTitleName" class="col-sm-12" type="text" class="form-control" placeholder="请输入职称名称">
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">选择科室:</label>
                                                    <div class="col-sm-8">
                                                        <input v-model="modifyStaffDetail.departmentName" @change="modifyAddSelectPatientList()" data-toggle="dropdown" type="text" class="form-control dropdown-toggle" style="width: 300px" placeholder="根据科室名称查询">
                                                        <ul role="menu" class="dropdown-menu" style="position: absolute;right: 15px">
                                                            <li v-for="modifyDepartment in modifyDepartmentList">
                                                                <a href="#" @click="modifyCheckThisDepartment(modifyDepartment.id,modifyDepartment.departmentName)">
                                                                    <span v-text="modifyDepartment.id">1</span>
                                                                    <span v-text="modifyDepartment.departmentName"> 曾晨</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                                <div class="btn-group col-sm-12" style="margin-bottom: 15px">
                                                    <label class="col-sm-4 control-label">工作人员类别:</label>
                                                    <div class="col-sm-8">
                                                        <button data-toggle="dropdown" class="btn btn-info dropdown-toggle" type="button">
                                                            <span v-text="modifyStaffDetail.jobTypeName">工作人员类别 </span>
                                                            <span class="caret"></span>
                                                        </button>
                                                        <ul role="menu" class="dropdown-menu">
                                                            <li><a href="#" @click="modifyCheckThisJobType(1,'缴费员')">缴费员</a></li>
                                                            <li><a href="#" @click="modifyCheckThisJobType(2,'护士')">护士</a></li>
                                                            <li><a href="#" @click="modifyCheckThisJobType(3,'医生')">医生</a></li>
                                                            <li><a href="#" @click="modifyCheckThisJobType(4,'药师')">药师</a></li>
                                                            <li><a href="#" @click="modifyCheckThisJobType(5,'管理员')">管理员</a></li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="modal-footer"  style="width: auto;height: auto;border: none">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                                <button type="button" class="btn btn-success" @click="modifyStaffDetailButton(modifyStaffDetail.staffId)">确认</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="clearfix">
                                    <div class="btn-group">

                                    </div>
                                    <div class="btn-group pull-right">
                                        <ul class="pagination pagination-sm">
                                            <li><a href="#"  @click.prevent="loadStaffList(pageinfo.prePage)">上一页</a></li>
                                            <li v-for="n in pageinfo.navigatepageNums" @click.prevent="loadStaffList(n)" :class="{'active': n == pageinfo.pageNum}">
                                                <a href="#" v-text="n">1</a>
                                            </li>
                                            <li><a href="#" @click.prevent="loadStaffList(pageinfo.nextPage)">下一页</a></li>
                                        </ul>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <!--页脚部分开始-->
        <footer>
            2022 &copy; <a href="https://gitee.com/allen-zc/OutpatientManagementSystem" target="_blank">基于SSM的门诊管理系统</a>
            -
            <a href="https://gitee.com/allen-zc" target="_blank">AllenChen曾晨</a>
            -
            <p style="display: inline-block">ALL RIGHTS RESERVED.</p>
        </footer>
        <!--footer section end-->
        <!--页脚部分结束-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="../../js/jquery-1.10.2.min.js"></script>
<script src="../../js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="../../js/jquery-migrate-1.2.1.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/modernizr.min.js"></script>
<script src="../../js/jquery.nicescroll.js"></script>

<!--时间风格及输入框风格-->
<!--pickers plugins-->
<script type="text/javascript" src="../../js/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-daterangepicker/moment.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
<script type="text/javascript" src="../../js/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
<!--pickers initialization-->
<script src="../../js/pickers-init.js"></script>
<!--时间风格及输入框风格-->

<!--data table-->
<script type="text/javascript" src="../../js/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="../../js/data-tables/DT_bootstrap.js"></script>

<!--common scripts for all pages-->
<script src="../../js/scripts.js"></script>


<script src="https://unpkg.zhimg.com/vue"></script>
<!--&lt;!&ndash; 开发环境版本，包含了有帮助的命令行警告 &ndash;&gt;-->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>-->
<!--&lt;!&ndash; 生产环境版本，优化了尺寸和速度 &ndash;&gt;-->
<!--<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>-->
<!--axios-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>

<!--菜单顶部导航栏-->
<script src="../../userjs/header.js"></script>
<!--表格设置-->
<script src="../../user/admin/js/user_list.js"></script>

<!--退出登录的方法-->
<script  type="text/javascript" charset="GB2312"  src="../../userjs/logout.js"></script>
<!--工具箱-->
<script src="../../js/utils.js"></script>

<script>
    let staffApp = new Vue({
        el:'#staffApp',
        data:{
            addSelectUserName:'',
            selectUserList:[],
            addUserId:'',
            addStaffName:'',
            addSexName:'性别',
            addSex:'',
            addJobTitle:'',
            addDepartmentName:'',
            addDepartmentId:'',
            selectDepartmentList:[],
            addJobType:'',
            addJobTypeName:'工作人员类别',

            selectStaffName:'',
            selectPageSizeName:'分页数',
            selectPageSize:'10',
            selectPageNum:'1',
            selectSexName:'选择性别',
            selectSex:'',
            selectJobTypeName:'工作类别',
            selectJobType:'',
            StaffList:[],
            pageinfo:{},

            modifyStaffDetail:{},
            modifyDepartmentList:[],

        },
        methods:{
            // 新增 查询用户列表
            addSelectUserList:function () {
                let form=new FormData();
                form.append("patientName",this.addSelectUserName);
                axios({
                    url:"/oms/user/selectUserList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    if(res.status == OK){
                        staffApp.selectUserList = res.data.list;
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 选择用户
            addCheckThisUser:function(userId,userName,userNickName){
                this.addUserId = userId
                this.addSelectUserName = userId + " " + userName + " " + userNickName
            },
            // 新增 选择性别
            addCheckThisSex:function (sexId,sexName) {
                this.addSexName = sexName
                this.addSex = sexId
            },
            // 新增 查询科室列表
            addSelectDepartmentList:function () {
                let form=new FormData();
                form.append("departmentName",this.addDepartmentName);
                axios({
                    url:"/oms/department/selectDepartmentList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    if(res.status == OK){
                        staffApp.selectDepartmentList = res.data.list;
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 选择科室
            checkThisDepartment:function (departmentId,departmentName) {
                this.addDepartmentId = departmentId
                this.addDepartmentName = departmentName
            },
            // 新增 选择工作人员类别
            addCheckThisJobType:function (jobType,jobTypeName) {
                this.addJobTypeName = jobTypeName
                this.addJobType = jobType
            },
            // 新增 保存员工信息
            saveAddStaff:function () {
                let staffDob = $('#addStaffBob').val()

                let form=new FormData();
                form.append("userId",this.addUserId);
                form.append("staffName",this.addStaffName);
                form.append("sex",this.addSex);
                form.append("dateOfBirth",staffDob);
                form.append("jobTitleName",this.addJobTitle);
                form.append("departmentId",this.addDepartmentId);
                form.append("jobType",this.addJobType);

                axios({
                    url:"/oms/staff/addStaff",
                    method:"post",
                    data:form
                }).then(function (res) {
                    if (res.data=='ok'){
                        alert("新增成功")
                        location.reload()
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 新增 取消按钮
            addStaffReset:function () {
                this.addSelectUserName=''
                this.selectUserList=[]
                this.addUserId=''
                this.addStaffName=''
                this.addSexName='性别'
                this.addSex=''
                this.addJobTitle=''
                this.addDepartmentName=''
                this.addDepartmentId=''
                this.selectDepartmentList=[]
                this.addJobType=''
                this.addJobTypeName='工作人员类别'
            },
            // 查询 员工列表
            selectStaffList:function () {
                if (this.selectPageNum==0||this.selectPageNum==''){
                    this.selectPageNum = 1
                }
                if (this.selectPageSize==0||this.selectPageSize==''){
                    this.selectPageSize = 10
                }
                let form=new FormData();
                form.append("staffName",this.selectStaffName);
                form.append("sex",this.selectSex);
                form.append("jobType",this.selectJobType);
                form.append("pageNum",this.selectPageNum);
                form.append("pageSize",this.selectPageSize);
                axios({
                    url:"/oms/staff/selectStaffList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    staffApp.StaffList = res.data.list
                    staffApp.pageinfo = res.data
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 查询 重置
            resetSelectStaffList:function () {
                this.selectStaffName=''
                this.selectPageSizeName='分页数'
                this.selectPageSize='10'
                this.selectPageNum='1'
                this.selectSexName='选择性别'
                this.selectSex=''
                this.selectJobTypeName='工作类别'
                this.selectJobType=''
                this.StaffList=[]
                this.pageinfo={}
                this.selectStaffList()
            },
            // 查询 选择分页数
            checkThisPageSize:function (pageSize) {
                this.selectPageSizeName=pageSize
                this.selectPageSize=pageSize
            },
            // 查询 选择性别
            checkThisSex:function (sex,sexName) {
                this.selectSexName = sexName
                this.selectSex = sex
            },
            // 查询 选择工作类别
            checkThisJobType:function (jobType,jobTypeName) {
                this.selectJobType = jobType
                this.selectJobTypeName = jobTypeName
            },
            // 修改 查询员工
            modifyStaff:function (staffId) {
                let form=new FormData();
                form.append("staffId",staffId);
                axios({
                    url:"/oms/staff/selectStaffDetail",
                    method:"post",
                    data:form
                }).then(function (res) {
                    staffApp.modifyStaffDetail = res.data
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 修改 查询科室
            modifyAddSelectPatientList:function () {
                let form=new FormData();
                form.append("departmentName",this.modifyStaffDetail.departmentName);
                axios({
                    url:"/oms/department/selectDepartmentList",
                    method:"post",
                    data:form
                }).then(function (res) {
                    if(res.status == OK){
                        staffApp.modifyDepartmentList = res.data.list;
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 修改 选择科室
            modifyCheckThisDepartment:function (departmentId,departmentName) {
                this.modifyStaffDetail.departmentName = departmentName
                this.modifyStaffDetail.departmentId = departmentId
            },
            // 修改 选择性别
            modifyCheckThisSex:function (sex,sexName) {
                this.modifyStaffDetail.sexName = sexName
                this.modifyStaffDetail.sex = sex
            },
            // 修改 选择员工类别
            modifyCheckThisJobType:function (jobType,jobTypeName) {
                this.modifyStaffDetail.jobTypeName = jobTypeName
                this.modifyStaffDetail.jobType = jobType
            },
            // 修改 确认修改
            modifyStaffDetailButton:function (staffId) {
                let modifyStaffDob = $('#modifyStaffDob').val()
                let form=new FormData();
                form.append("staffId",this.modifyStaffDetail.staffId);
                form.append("sex",this.modifyStaffDetail.sex);
                form.append("dateOfBirth",modifyStaffDob);
                form.append("jobTitleName",this.modifyStaffDetail.jobTitleName);
                form.append("departmentId",this.modifyStaffDetail.departmentId);
                form.append("jobType",this.modifyStaffDetail.jobType);

                axios({
                    url:"/oms/staff/updateStaff",
                    method:"post",
                    data:form
                }).then(function (res) {
                   if (res.data=='ok'){
                       alert("修改成功")
                       location.reload()
                   }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 删除员工
            deleteThisStaff:function (staffId) {
                axios({
                    url:"/oms/staff/deleteStaff/" + staffId,
                    method:"get",
                }).then(function (res) {
                    if (res.data=='ok'){
                        alert("删除成功")
                        location.reload()
                    }
                }).catch(function(error){
                    //失败运行这里,输出错误信息
                    alert(error)
                    console.log(error);
                })
            },
            // 上一页下一页
            loadStaffList:function (pageSize) {
                this.selectPageSize = pageSize
                this.selectStaffList()
            }
        },
        created:function () {
            this.selectStaffList()
        }
    })
</script>

</body>
</html>
